home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / closelibrary.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.6 KB  |  81 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: closelibrary.c,v 1.4 1996/08/13 13:55:59 digulla Exp $
  4.     $Log: closelibrary.c,v $
  5.     Revision 1.4  1996/08/13 13:55:59  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:07  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include <exec/execbase.h>
  17. #include <dos/dos.h>
  18. #include <aros/libcall.h>
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.     #include <clib/exec_protos.h>
  24.  
  25.     __AROS_LH1(void, CloseLibrary,
  26.  
  27. /*  SYNOPSIS */
  28.     __AROS_LHA(struct Library *, library,A1),
  29.  
  30. /*  LOCATION */
  31.     struct ExecBase *, SysBase, 69, Exec)
  32.  
  33. /*  FUNCTION
  34.     Closes a previously opened library. It is legal to call this function
  35.     with a NULL pointer.
  36.  
  37.     INPUTS
  38.     library - Pointer to library structure or NULL.
  39.  
  40.     RESULT
  41.  
  42.     NOTES
  43.  
  44.     EXAMPLE
  45.  
  46.     BUGS
  47.  
  48.     SEE ALSO
  49.     OpenLibrary().
  50.  
  51.     INTERNALS
  52.  
  53.     HISTORY
  54.  
  55. ******************************************************************************/
  56. {
  57.     __AROS_FUNC_INIT
  58.  
  59.     /* Something to do? */
  60.     if(library!=NULL)
  61.     {
  62.     /* Single-thread the close routine. */
  63.     Forbid();
  64.  
  65.     /* Do the close */
  66.     (void)__AROS_LVO_CALL0(BPTR,2,library);
  67.     /*
  68.         Normally you'd expect the library to be expunged if this returns
  69.         non-zero, but this is only exec which doesn't know anything about
  70.         seglists - therefore dos.library has to SetFunction() into this
  71.         vector for the additional functionality.
  72.     */
  73.  
  74.     /* All done. */
  75.     Permit();
  76.     }
  77.  
  78.     __AROS_FUNC_EXIT
  79. } /* CloseLibrary */
  80.  
  81.